home *** CD-ROM | disk | FTP | other *** search
- #include <Windows.h>
- #include <QuickDraw.h>
- #include <TextUtils.h>
- #include <Fonts.h>
-
- extern void SetupDragHiliteColor(WindowPtr);
-
- /*-------------------------------------------------------------------------------------*/
-
- void DrawIt(WindowPtr win)
- {
- short origFont, origSize;
-
- origFont = win->txFont;
- origSize = win->txSize;
- TextFont(helvetica);
- TextFace(bold);
- TextSize(14);
-
- SetupDragHiliteColor(win);
- PaintRect(&(*win).portRect);
- ForeColor(blackColor);
-
- MoveTo(10, 30);
- DrawString("\pThis is the hilite color used for drags");
-
- TextFont(origFont);
- TextSize(origSize);
- TextFace(0);
- }
-
-
- /*-------------------------------------------------------------------------------------*/
-
- pascal void DrawWindowContent(short pixelDepth, short dFlags, GDHandle theDevice, long theWin)
- {
- #pragma unused (pixelDepth, dFlags, theDevice)
- GrafPtr savePort;
-
- GetPort(&savePort);
- SetPort((GrafPtr)theWin);
-
- DrawIt((WindowPtr)theWin);
-
- SetPort(savePort);
- }
-
-
- /*-------------------------------------------------------------------------------------*/
-
- void CreateNewWindow(void)
- {
- Rect winDimension;
-
- SetRect(&winDimension, 60, 60, 360, 160);
- (void)NewCWindow(0L, &winDimension, "\pSample", true, noGrowDocProc,
- (WindowPtr)-1L, true, 0L);
- }
-
-
- /*-------------------------------------------------------------------------------------*/
-
- void PreEventLoop(void)
- {
- CreateNewWindow();
- }
-
-
- /*-------------------------------------------------------------------------------------*/
-
- void DoUpdate(WindowPtr thisWindow)
- {
- static DeviceLoopDrawingUPP procForDeviceLoop = nil;
-
- SetPort(thisWindow);
-
- if ( procForDeviceLoop == nil )
- procForDeviceLoop = NewDeviceLoopDrawingProc(DrawWindowContent);
-
- BeginUpdate(thisWindow);
- DeviceLoop(thisWindow->visRgn, procForDeviceLoop, (long)thisWindow, singleDevices);
- EndUpdate(thisWindow);
- }
-
-
- /*-------------------------------------------------------------------------------------*/
-
- void PostEventLoop(void)
- {
- }
-
-